home *** CD-ROM | disk | FTP | other *** search
/ Die Speccy' 97 / Die Speccy' 97.iso / amiga_system / the_aminet / comm / bbs / maxsbbsus.lha / MAX154 / TBM / Txt / Fakekey.txt < prev    next >
Text File  |  1995-09-29  |  13KB  |  315 lines

  1.  
  2.   I've just got to tell you about my two new buddies, FakeKey and
  3. MovePointer.  These guys are hysterical!  Not to mention real life-savers.
  4.  
  5.   FakeKey simulates a keyboard input.  If you're editing a text file, and run
  6. FakeKey, the little letters will pop onto the screen like you're typing them.
  7.  
  8.   The important thing is that you can combine ANY key combination, including
  9. the left-Alt/left-Amiga, or right-Alt/right-Amiga.  Those, of course, are
  10. your two mouse buttons.  Okay, so much for the keyboard and mouse buttons,
  11. now for the pointer.
  12.  
  13.   MovePointer is a simple program that moves the pointer to a specified x-y
  14. position.  Nothin' fancy there.  Yet.
  15.  
  16.   What we can do is move the pointer to wherever we want, such as up to a
  17. title bar, hold down the right mouse button with FakeKey, pull the pointer
  18. down the drop-down menu, then release the right mouse button, opening a
  19. requester.  The pointer could then move to a specific location in the
  20. requester, FakeKey could clear the box and input new information or click on
  21. a file, then Save the information and close the requester.
  22.  
  23.   Congratulations, Mr. Computer Operator, you've just been replaced.
  24.  
  25.   What's `hysterical' about it is that it's like watching a ghost operate
  26. your computer, really neat.  But functionwise, with my new BBS software, the
  27. two of them have already solved a few nagging problems, and I wouldn't have a
  28. CD Of The Month without them.
  29.   
  30.   I'll give a few examples in sec, but for those of you who were just
  31. curious, let me sum up by saying, `just keep them in mind'.  There may come a
  32. time when you need the computer to perform a function while you're not there,
  33. a function that...in the old days...only you could do.
  34.  
  35.   FakeKey is 2.x-only, so if you're running under 1.3, there's most likely
  36. a similar program out there that'll work.
  37.  
  38.                                       *
  39.  
  40.   First, something to note about FakeKey:  When you enter a FakeKey command,
  41. it STAYS that way until further notice.  So whenever you make a "left mouse
  42. click" with the commands "lalt lcommand", you then need to FakeKey some
  43. innocuous command to release it.  I use the Help key unless I'm editing a
  44. text file, in which case a shift or backspace or something else will do.
  45.  
  46.                                       *
  47.  
  48.   Example 1 -  Changing the info in a requester box:
  49.  
  50.   What you basically do with your scriptfile is step-by-step make the exact
  51. same moves (pointer, mouse and keyboard) that you would normally make to
  52. change whatever it is you're changing.
  53.  
  54.   MP brings the pointer up to the title bar.
  55.  
  56.   FK holds the RMB down, the drop-down menu shows the selections.
  57.  
  58.   MP pulls the pointer down to the operation you want.
  59.   
  60.   FK releases the RMB, the requester pops open.
  61.  
  62.   Wait 2 while the requester opens.
  63.  
  64.   If you just need to click on an OK box or something, use MP to get you
  65. there, then FK to simulate the LMB.
  66.  
  67.   If you need to enter data, unless the cursor's already in the correct box,
  68. use MP to get you there, then FK to hit the LMB to activate the box.
  69.  
  70.   FK clears the box with right-Amiga-x.
  71.  
  72.   FK inputs the new data.
  73.  
  74.   Then you either have FK hit Return to close the requester or have MP go to
  75. the OK box and FK closes it.  Ta-da!
  76.  
  77.  
  78.   Two quick notes:
  79.  
  80.   > First copy FK to ram, then make all the "FK"s in the scriptfile use the  
  81.     Ram comand, just to save on disk wear.
  82.  
  83.   > Make sure you Wait when necessary in the scriptfile, like when opening
  84.     and closing requesters or windows.  I usually put in too many Wait 
  85.     commands then pare things down later.
  86.  
  87.  
  88.   Example 2 - FakeKey Saves The CD Of The Month's Butt
  89.  
  90.   I needed to get some way that the members could issue a written request,
  91. so I checked out a few Questionaire doors, and settled on this "Program
  92. Request" door, which lets the users request files in a separate area, rather
  93. than the message base.  So far, so good, only hassle is that all the
  94. questionaire-type programs leave more on the line than just the request.
  95.  
  96.   The ProgReq program saves the request as a binary file (has ANSI in it),
  97. so the first thing that has to be done is to run Edible on it, to debinaryize
  98. it.  Then FakeKey really struts its stuff.  The member enters his request,
  99. hits the key, and in the background:
  100.  
  101.   The scriptfile first runs Edible on the request, to remove the binary.
  102.  
  103.   It then runs Ed to edit the new file.
  104.  
  105.   There's some "[32m" garbage left over from the stripped binary, so the 
  106.     first thing FK does is esc-d-return a few times to delete the first
  107.     couple of lines.
  108.  
  109.   The line with the actual request in it looks something like this:
  110.  
  111.                  [35m[10CSysOp requested : honeyb.gif
  112.  
  113.   FK enters esc-f-'-:-return, to search for the ":" in front of the file.
  114.   The cursor jumps out to the ":".
  115.  
  116.   FK moves the cursor two spaces over to the right, over the "h" in "honeyb".
  117.  
  118.   FK moves the cursor to the left a bunch of times, to erase everything to
  119.     the left of the file name all the way to the left margin.  The only thing
  120.     on the line now is the requested file name.
  121.  
  122.   FK inserts "Copy CD0:GIFS/#?/" in front of the file name.
  123.  
  124.   FK enters right-shift/right-arrow to bring the cursor to the end of the 
  125.     file name.
  126.  
  127.   FK moves one space, then enters "Pics:temp", the destination directory.
  128.  
  129.   FK enters esc-x-return to save the file.
  130.  
  131.   The scriptfile then Executes the saved file, which will:
  132.  
  133.                   Copy CD0:GIFS/#?/honeyb.gif Pics:temp
  134.  
  135.   The wildcards are so it can search through all the disk's subdirectories,
  136. Pics:temp is where the file is stored.  The member then hits the "Freshen up
  137. download directory" function, which executes a scriptfile that Lists out the
  138. contents of the Pics:temp directory, which the member can then read,
  139. verifying that the file was found.  He then downloads it, confused by all the
  140. rigamarole he had to go through, but grateful he's getting his file. :)
  141.  
  142.   But hey, it was either that, or log on 7,000 GIF pictures for just one
  143. month.  Thanks, but no thanks.
  144.  
  145.  
  146. Example 3 - Endless Returns
  147.  
  148.   For some odd reason, there's no Continuous Read on my BBS, so if you want
  149. to list pages and pages of files, you have to keep hitting the Return over
  150. and over again.  Ah-ha!  I whip up a scriptfile called Ram:xx that says:
  151.  
  152.   FK 0 return
  153.   Wait 2
  154.   Execute Ram:xx
  155.  
  156.   I then go to the BBS, flip on the Capture Buffer, list the first page of
  157. files, go back to the Workbench, Execute the file Ram:xx, then flip back to
  158. the BBS.  FakeKey hits the Return for me, waits two seconds for the files
  159. to display, then Executes itself all over again.  When I get done, I flip
  160. back to the Workbench and enter Ctrl-D to interrupt the scriptfile.  Yes, I
  161. then remember to flip back to the BBS to turn off the Capture Buffer. :)
  162.  
  163.   
  164. Example 4 - Manipulating windows
  165.  
  166.   I had this animation of my love, Amy The Squirrel, in FLC format, which is
  167. some Mac thing.  It was just a simple black & white drawing of her walking
  168. along, about 20 frames, but naturally she looked terrific, and I knew it
  169. would make a great addition to the collection.
  170.  
  171.   The big problem, of course, was converting this .FLC animation to IFF.
  172. Hunted all over the place, never found a converter, and neither ImageFX nor
  173. ADPro's animation sequencers would handle it.  But, thankfully, at least
  174. ADPro recognized it as a format.  I could load it up as an anim, and the
  175. first frame would load.  I could then convert it to 4-color IFF like normal,
  176. and save the frame.  Much to my surprise, when I re-loaded the anim, this
  177. time it was on frame 2, which I could then convert and save.  And then frame
  178. 3, then frame 4.  Ah-ha!
  179.  
  180.   My FakeKey/MovePointer scriptfile basically did just what I did above,
  181. with a few keyboard command shortcuts used instead of MovePointer.  It
  182. loaded and re-loaded all 20 frames, rendering and saving each frame in the
  183. process.  I then simply combinded the frames with MakeAnim and had a
  184. completely unique file for the board.
  185.  
  186.   The main way it varied from doing it by hand was the naming of each saved
  187. frame.  I just had the scriptfile enter a "1" each time, so the file names
  188. ended up being "1", "11", "111", "1111", etc, so having to rename them all
  189. was a tad tedius, but the only work I, myself, had to do.  When I come across
  190. a 200-frame .FLC animation I just have to have, I'll work on it.
  191.  
  192.   
  193. Example 5 - converting board file descriptions to file_id.dizs
  194.  
  195. This was pretty clever, using both SmartDOS (see other file) and FakeKey
  196. together.  I first made a capture buffer of, let's say, the sound effects.
  197. Whole bunch of them, over 100.  I edit the capture buffer and strip out the
  198. file names & sizes, leaving just the descriptions.  Got it pictured?  Just a
  199. long list of file descriptions.  I close the Ed window down to its smallest
  200. size and position it down at the bottom of the screen.  This way MovePointer
  201. will know where it is.
  202.  
  203. I then use SmartDOS to make a list of all the sound effect archives (the
  204. directory I've Assigned XXX: to) and run the same scriptfile on each one of
  205. them.  The SmartDOS "Echo" string is:
  206.  
  207. Execute ed.scp
  208. Wait 1
  209. LZX u XXX:<name> Ram:file_id.diz
  210.  
  211. The "Execute ed.scp" script moves the pointer to the open Ed window, clicks
  212. on it to activate it, then blocks off the first file description and writes
  213. it to the file "Ram:file_id.diz".  It then deletes the line, ready for the
  214. next one.  The SmartDOS file continues, using LZX to U)pdate the file with
  215. the new file_id.diz file.  It then repeats the same operation to the next
  216. file, etc.  Worked perfectly, only thing I had to pay attention to was making
  217. sure the file descriptions lined up correctly with the actual files.
  218.  
  219.  
  220. Example 6 - loading up requesters
  221.  
  222. This is a real lifesaver.  I've got this new BBS software and it uses the
  223. asl.library for loading files onto the board.  Only one little hitch: I'm
  224. loading up 100 files at a time, and the requester doesn't have any kind of
  225. "batch load" feature.  What it really needs is an ALL box to highlight all
  226. the files, but I'd settle for a shift-scroll routine.  Unfortunately, you
  227. have to hold the shift bar down by hand and laboriously click each file.
  228.  
  229. Used to, that is.
  230.  
  231. The FakeKey/MovePointer file, itself, is pretty simple.  Before you start,
  232. you first open the requester and load up the dir.  You then start the
  233. scriptfile, which first goes to the top of the slide gadget box and clicks
  234. once, to make sure everybody is alphabetized.  It then goes to the first
  235. selection, clicks, moves down (holding the shift key down all the while),
  236. clicks on the next file, etc.  When it gets to the bottom, assuming it's
  237. going to continue, it zips over to the bottom of the slide gadget box and
  238. clicks once, to advance to the next page.
  239.  
  240. I have a "20" scriptfile which goes down two pages, a "30" for three pages,
  241. etcetera up to "100".  What makes this particular routine fun is that I use
  242. Switcher to start up the scripts with.  Switcher is a screen controller that
  243. opens up a small box when you click on both mouse buttons.  You can go to any
  244. screen listed, as well as execute external commands and scriptfiles.  So, I
  245. don't even have to go over to the Workbench to start the scriptfile, I just
  246. load up the requester, hit the mouse buttons, choose the approriate script-
  247. file and off we go.  
  248.  
  249.  
  250. Example 7 - Breaking up a big list into smaller ones
  251.  
  252.   Problem:  You have a list of 860 graphic archives, with descriptions.  The
  253. list is composed of JPEG, GIF, AGA and IFF pics, animations, DCTV files, a
  254. couple of odd things like "X-Specs", etc, and you want to split them all into
  255. different lists.  Quite the imposing little task to do manually.
  256.  
  257.   FakeKey saves your little butt AGAIN!!
  258.  
  259.  
  260. > You pop up the list in a text editor, preferably a smart one like CygnusEd.
  261.   You want an editor that has a Search box that opens up, where you insert 
  262.   the word you're looking for, so it'll still be there for the next search.
  263.   You could use a placcid text editor like Ed, and have FakeKey enter in a
  264.   "esc-f-"-g-i-f-Return" to find the GIF file, and "esc-d-Return" to delete
  265.   the line, but it'd take a lot longer.
  266.  
  267. > You search for the word "gif".  The editor zips down to the first GIF pic.
  268.  
  269. > You kill the line.
  270.  
  271. > Let's say the Search feature is R-Amiga-s, and the K)ill is R-Amiga-k.  You
  272.   write up a scriptfile that says:
  273.  
  274. FK 0 s         ; searches for next "gif"
  275. Wait 0         ; small rest stop*
  276. FK 0 k         ; kills line
  277. Wait 0         ; small rest stop
  278.  
  279. FK 0 s
  280. Wait 0
  281. FK 0 k
  282. Wait 0
  283.  
  284. FK 0 s
  285. Wait 0
  286. FK 0 k
  287. Wait 0
  288.  
  289. <etc about fifty times>
  290.  
  291. * FakeKey and MovePointer are both pretty tiny, so when run out of Ram, you
  292. need to leave a bit of time for the actual physical manipulation of the text.
  293.  
  294.   That goes through the file and kills every GIF pic.  You save the file as
  295. "nogifs".  
  296.  
  297. > The program "Diff" tells you the difference between two textfiles.  You
  298.  
  299. Diff >gif.list -c original.file nogifs
  300.  
  301.   That compares the two files and spits out the difference to a file called
  302. "gif.list".  That's your list of GIF pics.  Clever, huh?  And discounting the
  303. two "Wait 0" lines in the scriptfile, all it took was two FakeKey commands
  304. and a quick run through Diff.  Piece o' cake.
  305.  
  306. > Repeat above procedure for "jpg" and "jpeg", to catch all the JPEG pics, 
  307.   ditto everything else.  By the time you strip out all the pics, all that 
  308.   remains are, in theory, the tools.
  309.  
  310.  
  311.   Hope you enjoy FakeKey and MovePointer!
  312.  
  313.  
  314. %Z
  315.